<include file="public:head"/>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1" /> 
    <title>微信支付样例付款</title>
    <style type="text/css">
        .yisulayer {
            background: #323a45 !important;
        }
    </style>
</head>
<body>
	<input type="hidden" value="<?php echo $_GET['orderid'];?>" id="orderid">
<!-- 	<input type="hidden" value="20181015203145795257" id="orderid"> -->
	<div style="margin-left: 10px;color:#556B2F;font-size:30px;font-weight: bolder;margin: 150px auto 0;text-align: center;">扫描支付</div><br/>
    <div style="margin:10px auto;width: 280px;overflow: hidden;height: 280px;box-shadow: 0 0 10px #ccc;border-radius: 4px;">
        	<img alt="模式二扫码支付" src="../pay/example/qrcode.php?data=<?php echo urlencode($url);?>" style="width:260px;height:260px;display: block;margin: 10px auto;"/>
    </div>
	<div style="color:#ff0000;margin-bottom: 40px;text-align: center;font-size: 22px;margin-top:10px;"><b><?php echo $_GET['money'];?>元</b></div>
<include file="public:foot"/>
</body>
</html>
<script src="../js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var t1;
var sum = 0;	
$(document).ready(function () {
    setInterval("ajaxstatus()", 3000);    

function ajaxstatus() {
	sum ++;
	if(sum > 600) {window.clearInterval(t1);return fasle;}
	if(sum >180){
		m = sum%10;
		if(m!=0){return false;}
	}
	var urls = "{:U('home/recharge/paystatus')}";
    var orderid = $("#orderid").val();
    if (orderid != 0) {
        $.ajax({
            url: urls,
            type: "POST",
            dataType:"json",
            data: {
                orderid: orderid,
            },
            success: function (msg) {
            	window.clearInterval(t1);
            	if(msg == 1){
            		window.location.href = "{:U('home/recharge/rechargesuccess')}";
            	}
            }
        });
    }
} 

t1 = window.setInterval(ajaxstatus, 1000);   
});
</script>